import { ILoadMapTypeAll } from '@/common';
import { getLevelZeroJson, getSelectDataCommon, getTenantID } from '@/utils';
import { ISourceIntentionAPI } from '../common/type';

/**
 * @param {Object} loadMdicMapList 数据字典
 * */
const ManageSearchColumns = (loadMdicMapList: Record<string, any>, areaListData: any[]): ISourceIntentionAPI.IHeaderSearchType => {
  const state = getSelectDataCommon(loadMdicMapList?.[`${getTenantID()}${ILoadMapTypeAll.DISCLOSURE_STATE}`], 'name', 'id');

  const searchColumns: ISourceIntentionAPI.ISearchList = [
    {
      name: 'intentName',
      placeholder: '意向公开名称',
      label: '意向公开名称',
      componentType: 'Input',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'purchaseInfo',
      placeholder: '采购需求概况',
      label: '采购需求概况',
      componentType: 'Input',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'remark',
      placeholder: '备注',
      label: '备注',
      componentType: 'Input',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'state',
      placeholder: '状态',
      label: '状态',
      componentType: 'Select',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
      dataSource: state,
    },

    // {
    //   name: 'expectSum',
    //   placeholder: '预算费用',
    //   label: '预算费用',
    //   componentType: 'NumberRange',
    //   allowClear: true,
    //   md: 6,
    //   sm: 24,
    //   whetherSenior: false,
    // },
    // {
    //   name: 'applyPhone',
    //   placeholder: '联系电话',
    //   label: '联系电话',
    //   componentType: 'Input',
    //   allowClear: true,
    //   md: 6,
    //   sm: 24,
    //   whetherSenior: false,
    // },
    // {
    //   name: 'createTime',
    //   placeholder: '',
    //   label: '创建时间',
    //   componentType: 'RangePicker',
    //   allowClear: true,
    //   md: 6,
    //   sm: 24,
    //   whetherSenior: true,
    // },
    {
      name: 'createFormName',
      placeholder: '申请',
      label: '申请',
      componentType: 'DeptAndUser',
      dataSource: getLevelZeroJson() ?? [],
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: true,
      formOrgType: {
        COMP: 'createCompanyID',
        DEPT: 'createDepartmentID',
        POS: 'createPositionID',
        USER: 'createrID',
      },
    },

    // {
    //   name: 'expectTime',
    //   placeholder: '',
    //   label: '预计采购时间',
    //   componentType: 'RangePicker',
    //   allowClear: true,
    //   md: 6,
    //   sm: 24,
    //   whetherSenior: true,
    // },
    // {
    //   name: 'applyPhone',
    //   placeholder: '联系方式',
    //   label: '联系方式',
    //   componentType: 'Input',
    //   allowClear: true,
    //   md: 4,
    //   sm: 24,
    //   whetherSenior: true,
    // },
  ];

  return searchColumns;
};

export { ManageSearchColumns };
